package org.hive.vmware.client.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class VmGroupingVO implements Serializable {
	private static final long serialVersionUID = 1L;
	
	private List<VmVO> ungroupedVOs;
	private List<VmGroupVO> groupVOs;
	
	public VmGroupingVO() {
		ungroupedVOs = new ArrayList<VmVO>();
		groupVOs = new ArrayList<VmGroupVO>();
	}
	
	public void setUngroupedVOs(List<VmVO> ungroupedVOs) {
		this.ungroupedVOs = ungroupedVOs;
	}
	public List<VmVO> getUngroupedVOs() {
		return ungroupedVOs;
	}
	public void setGroupVOs(List<VmGroupVO> groupVOs) {
		this.groupVOs = groupVOs;
	}
	public List<VmGroupVO> getGroupVOs() {
		return groupVOs;
	}
	
	public boolean add(VmGroupVO vmGroup) {
		return groupVOs.add(vmGroup);
	}
	
	boolean containsGroupName(VmGroupVO vmGroup) {
		for (VmGroupVO group : groupVOs) {
			if (group.getName().equals(vmGroup.getName())) {
				return true;
			}
		}
		return false;
	}
}
